#include "crpc.h"
#include <exception>
#include <iostream>

extern "C" SRPC_RESULT SafeAddService(SRPC_DEALER dealer,
                                   const char* name,
                                   const char* desc,
                                   const char* defs,
                                   const char* rtns) {
    try {
        return srpc_add_service(dealer, name, desc, defs, rtns);
    } catch (...) {
        std::cerr << "Caught unknown exception (possibly soraka::stk_result)" << std::endl;
        return SRPC_EUNKNOWN;
    }
}